package com.heatup.apt.common.constants;

import com.heatup.apt.common.util.StringUtil;

/**
 * Created by b3st9u on 16/8/27.
 */
public class ResourceContants {
    public enum ResourceResKeyEnmu {
        enter_store_banner("top_banner", "进店模式顶部banner"),
        enter_store_common("common", "进店模式普通视频"),
        enter_store_middle("middle_banner", "进店模式中间横图");

        private String key;
        private String value;

        ResourceResKeyEnmu(String key, String value) {
            this.key = key;
            this.value = value;
        }

    }

    public enum ResourceResTypeEnum {
        image(1, "1", "image"),
        video(2, "2", "video"),
        article(3, "3", "article");
        private int index;
        private String type;
        private String title;

        ResourceResTypeEnum(int index, String type, String title) {
            this.index = index;
            this.type = type;
            this.title = title;
        }
        public static ResourceResTypeEnum getResType(String type){
            if(StringUtil.isEmpty(type))
                return null;
            for(ResourceResTypeEnum resType :ResourceResTypeEnum.values()){
                if(StringUtil.isEquals(resType.getType(), type)){
                    return resType;
                }
            }
            return null;
        }
        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }
    }
}
